package com.sskj.mine.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.mine.http.HttpConfig;
import com.sskj.mine.ui.activity.PwdChangeActivity;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.ToastUtil;
import com.sskj.lib.http.JsonCallBack;


public class PwdChangeActivityPresenter extends BasePresenter<PwdChangeActivity> {

    public void changePwd(String originPwd, String newPwd, String newPwdAgain) {
        httpService.changePwd( originPwd,newPwd, newPwdAgain)
                .execute(new JsonCallBack<HttpData>() {
                    @Override
                    public void onSuccess(Response<HttpData> response) {
                        HttpData httpData = response.body();
                        ToastUtil.showShort(httpData.getMsg());
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.resetSuccess();
                        }
                    }
                });
    }
}
